<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.List"%>
<%@page import="dto.ArticuloDTO"%>
<%@page import="java.util.ListIterator"%>

<html>
<head>

  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title> Administrador de casa central </title>
  <LINK REL=StyleSheet HREF="styles/style.css" TYPE="text/css" MEDIA=screen>
   <LINK REL=StyleSheet HREF="styles/jquery-ui-1.8.13.custom.css" TYPE="text/css" MEDIA=screen>
  <script type="text/javascript" src="javascripts/jQuery.js"></script>
  <script type="text/javascript" src="javascripts/jquery-ui-1.8.13.custom.min.js"></script>
  <script type="text/javascript" src="javascripts/application.js"></script>
</head>
<body>
	<div class="wrapped">
	<div class="menuDiv">
		
		<jsp:include page="menu.jsp"></jsp:include>
	
		<br />
	</div>
	<div class="content">
	
	<!-- Contenido de la página -->
	<h1> Listado de Articulos </h1>
	<%String mensaje = (String)request.getAttribute("mensaje"); %>
	<em class="error-messages"><%=mensaje==null? "" : mensaje%></em>
	<div class="contenedor">
		<div class="boton-alta"> <a href="nuevo-articulo.html"><input type="button" value="Alta Articulo"></a></div>
		<div class="table-container">
		<table id="listado-articulos" class="admin-table" >
			<tr>
				<th> Nombre </th>
				<th> Codigo </th>
				<th> Tipo </th>
				<th> xml </th>
			</tr>
			<%
				List<ArticuloDTO> articulos = (List<ArticuloDTO>) request.getAttribute("articulos");
				if(articulos!=null && !articulos.isEmpty()){
					for(ArticuloDTO art : articulos){
			%>
			<tr>
				<td><%=art.getNombre()%></td>
				<td> <%=art.getRef()%> </td>
				<td> <%=art.getType()%></td>
				<td><a href="<%="file:///" + art.getXmlpath()%>"><%="file:///" +art.getXmlpath()%></a></td>
				<td>
					<a href="#">
						<input type="button" value="Mostrar Completo" id="<%=art.getRef()%>" class="mostrar-completo" />
					</a>
				</td>
			</tr>
			<%} } %>

		</table>
		</div>
	</div>
	</div>
</div>
<div id="modal"></div>
</body>
</html>